<template>
  <div class="ii-wrap">
    <div class="ii-wrap-left task">
      <div class="ii-wrap-left-one" :class="myAddFans === 0 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(0)">连麦涨粉</div>
      <div class="ii-wrap-left-one" :class="myAddFans === 1 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(1)">新建任务</div>
      <div class="ii-wrap-left-one" :class="myAddFans === 2 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(2)">任务管理</div>
      <!-- <div class="ii-wrap-left-one" :class="myAddFans === 3 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(3)">粉丝动态</div> -->
    </div>
    <div class="li-wrap-right">
      <nuxt-child/>
    </div>
  </div>
</template>
<script>
// import Bus from '../api/bus.js'
export default {
  async fetch({store}) {
    await store.commit('setInterIndex', 1)
  },
  layout: 'internalouts', 
  components: {
  },
  computed: { //计算属性
    myAddFans(){
      return  this.$store.state.myAddFans
    }
  },
  data() {
    return {
      index: 0, // 当前选择的页面
    }
  },
  methods: {
    toggleIndex(index) {
      this.$store.commit('setMyAddFans', index)
      this.index = index
      if (index === 0) {
        this.go('/myAddFans')
      } 
      if (index === 1) {
        this.go('/myAddFans/newtask')
      } 
      if (index === 2) {
        this.go('/myAddFans/taskmanage');
      } 
      if (index === 3) {
        this.go('')
      } 
    }
  }
}
</script>

<style scoped>
  .ii-wrap {
    display: flex;
    justify-content: space-between;
    min-width:1200px;
  }

  .ii-wrap-left {
    background: #efefef;
    min-width: 220px;
    border-radius: 4px;
    font-weight:bold;
    box-shadow: 0px -4px 5px #f4f4f4;
    position:relative;
  }
  .li-wrap-right {
    flex:1;
    margin: 20px;
    min-width:940px;
  }
  .ii-wrap-left-one {
    height: 50px;
    border-bottom: 1px solid #f4f4f4;
    line-height: 50px;
    padding-left: 30px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    position: relative;
    user-select: none;
  }
  .ii-wrap-left-item {
    border-bottom: 1px solid #f4f4f4;
    padding-bottom: 20px;
    user-select: none;
  }
  .ii-wrap-left-item p {
    cursor: pointer;
  }
  .ii-wrap-left-item .p1 {
    font-size: 14px;
    color: #333;
    position: relative;
    height: 50px;
    line-height: 50px;
    padding-left: 30px;
  }
  .ii-wrap-left-item .p2 {
    font-size: 14px;
    color: #666;
    padding-left: 30px;
  }
  .ii-wrap-left-item .p3 {
   margin-top: 20px;
  }
  .ii-wrap-left-last {
    height: 50px;
    line-height: 50px;
    padding-left: 30px;
    font-size: 14px;  
    color: #333;
    cursor: pointer;
    position: relative;
    border-bottom: 1px solid #f4f4f4;
  }
  .ii-line-active::before {
    content: '';
    width: 3px;
    height: 26px;
    background: #0096e6;
    position: absolute;
    left: 0;
    top: 12px;
  }
  .ii-text-active {
    color: #0096e6 !important;
    background:rgba(230,230,230)
  }
  /* 任务管理的弹出框 */
  .tooltip-my-fans {
    top: 86px;
    left: 9px;
  }
  .control-tooltip {
    position:absolute;
    top: 84px;
    left:40px;  
    z-index:1000;
  }
  .jus-layout {
    display:flex;
  }
  .control-tooltip .next,
  .control-tooltip .stop{
    width:92px;
    height:34px;
    line-height:34px;
    text-align:center;
    box-sizing:border-box;
    color:#ffffff;
    border-radius:17px;
    cursor: pointer;
  }
  .control-tooltip .next {
    border:1px solid #ffffff;
  }
  .control-tooltip .stop {
    background:#ffffff;
    color:#0096e6;
  }
</style>
